package com.improve.frame.common.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description
 *      部门
 * @Author wzxing918
 * @Date 2021-03-31
 * @Version 1.0.0
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_dept")
@ApiModel(description = "部门")
public class SysDept extends BaseEntity {
    /**
     * 父部门id
     */
    @ApiModelProperty(value = "父部门id", name = "parentId",example = "0")
    private Long parentId;
    /**
     * 祖级列表
     */
    @ApiModelProperty(value = "祖级列表", name = "ancestors")
    private String ancestors;
    /**
     * 部门名称
     */
    @ApiModelProperty(value = "部门名称", name = "deptName")
    private String deptName;
    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "显示顺序", name = "orderNum",example = "0")
    private Integer orderNum;
    /**
     * 负责人
     */
    @ApiModelProperty(value = "负责人", name = "leader")
    private String leader;
    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话", name = "phone")
    private String phone;
    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", name = "email")
    private String email;
    /**
     * 部门状态（1正常 2停用）
     */
    @ApiModelProperty(value = "部门状态（1正常 2停用）", name = "status",example = "0")
    private Integer status;
    /**
     * 删除标志（1代表存在 2代表删除）
     */
    @TableLogic
    @ApiModelProperty(value = "删除标志（1代表存在 2代表删除）", name = "delFlag",example = "0")
    private Integer delFlag;

    /** 父部门名称 */
    @TableField(exist = false)
    private String parentName;

    /** 子部门 */
    @TableField(exist = false)
    private List<SysDept> children = new ArrayList<>();
}
